﻿using System;
using System.Collections.Generic;
using System.Text;

namespace PacMan3D.Utils
{
    /// <summary>
    /// This class represents a Random Number Generator.
    /// </summary>
    public class RandomNumber
    {
        private static RandomNumber instance;
        private int MinVal { get; set; }
        private int MaxVal { get; set; }
        private Random RandomClass;

        private RandomNumber()
        {
            this.RandomClass = new Random();
        }

        public static RandomNumber Instance()
        {
            if (instance == null)
                instance = new RandomNumber();
            return instance;
        }

        public float NextFloat()
        {
            return (float)this.RandomClass.NextDouble();
        }

        public float NextInt()
        {
            return (float)this.RandomClass.Next(this.MinVal, this.MaxVal);
        }

        public int NextInt(int minVal, int maxVal)
        {
            return this.RandomClass.Next(minVal, maxVal);
        }
    }
}
